<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline" style="padding-left: 5px;">
            <input type="text" name="username" lay-verify="title" placeholder="Input username" autocomplete="off"
                   class="layui-input" value="" style="width: 200px;">
        </div>
        <div class="layui-inline" style="padding-left: 5px;">
            <input type="text" name="amount" lay-verify="title" placeholder="Input amount" autocomplete="off"
                   class="layui-input" value="" style="width: 200px;">
        </div>
        <div class="layui-inline" style="padding-left: 5px;">
            <input type="text" name="pay_user" lay-verify="title" placeholder="pay user" autocomplete="off"
                   class="layui-input" value="" style="width: 200px;">
        </div>

        <div class="layui-inline">
            <div class="layui-input-inline seller-inline-4">
                <input type="text" name="datetime" id="datetime" placeholder="start_time _ end_time" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <select name="status_check" >
                <option value="">支付状态</option>
                <option value="0">未处理</option>
                <option value="1">已处理</option>
                <option value="2">充值失败</option>
                <option value="3">已过期</option>
                <option value="4">取消充值</option>
                <option value="5">工单处理</option>
                <option value="6">超额等处理</option>
            </select>
        </div>
        <div class="layui-inline">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-sm" lay-submit lay-filter="*"><i class="iconfont icon-chaxun"></i>Search</button>
            </div>
        </div>
    </div>
</form>
<div class="table-body">
    <table id="balanceTable" lay-filter="balanceTable"></table>
</div>
<script>
    layui.use(['form', 'laydate', 'table',], function () {
        var laydate = layui.laydate,
            form = layui.form,
            table = layui.table; //表格
        //时间插件
        laydate.render({
            elem: '#datetime',
            range: '_',
            format: 'yyyy-MM-dd'
        });
        table.render({
            elem: '#balanceTable',
            height: 'full-99',
            cellMinWidth: '80',
            totalRow: true,
            method: 'post',
            url: "{:url('usdtFund')}",
            id: 'balanceTable',
            cols: [[
                { type: 'numbers'},
                { field: 'username',  align: 'left', title: 'username',width:180},
                { field: 'out_trade_no',  align: 'left', title: 'out_trade_no',width:210},
                { field: 'amount', title: '充值金额', align:"right",
                    style:'color:#FF5722;font-weight:bold', totalRow: true,width:150},
                { field: 'amount_real', title: '实冲金额', align:"right",
                    style:'color:#FF5722;font-weight:bold', totalRow: true,width:150},
                { align: 'left', title: '支付状态',width:90,
                    templet: function (d) {
                        const status_check=d.status_check;
                        var   color = "#6c757d";
                        var   show_name = '等待中';
                        if(status_check == 1){
                            color = 'green';
                            show_name = '已支付';
                        }else if(status_check == 2){
                            color = 'red';
                            show_name = '充值失败';
                        }else if(status_check == 3){
                            color = '#7DA0B1';
                            show_name = '已过期';
                        }else if(status_check == 4){
                            color = '#e4606d';
                            show_name = '取消充值';
                        } else if(status_check == 5){
                            color = '#e4606d';
                            show_name = '工单处理';
                        }else if(status_check == 6){
                            color = 'red';
                            show_name = '<a class="layui-btn layui-btn-xs" href="' + "{:url('usdtActionLimit')}?id=" + d.id + '">超额等处理</a>';
                        }
                        return '<span style="color: ' + color + '">' + show_name + '</span>';
                    }
                },
                { align: 'left', title: '数据录入',width:90,
                    templet: function (d) {
                        const status_used=d.status_used;
                        return (status_used==1)?'<span style="color:green">已录入</span>':'<span style="color:red">未录入</span>';
                    }
                },
                { field: 'ctime',  align: 'left', title: '创建时间',width:180},
                { field: 'utime',  align: 'left', title: '结束时间',width:180},
                { field: 'msg',  align: 'left', title: 'msg',width:260},
                { field: 'pay_user',  align: 'left', title: 'pay_user',width:250},
                { field: 'id',  align: 'left', title: 'id',width:100},
            ]],
            page: true,
            limit: 50,
            limits: [50,1000, 10000],
        });
        form.on('submit(*)', function (data) {
            layui.table.reload('balanceTable', {
                where: data.field
                , page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>